﻿using System.Net.NetworkInformation;

namespace KD.Sms
{
    public class NetJudger
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ip"></param>
        /// <returns></returns>
        public static bool DoJudge(string ip)
        {
            try
            {
                Ping ping = new Ping();
                PingReply pingReply = ping.Send(ip);
                return pingReply.Status == IPStatus.Success;
            }
            catch
            {
                return false;
            }
        }
    }
}
